module ALU_Control(
  input       [5:0]   funct,
  input       [2:0]   ALUop,
  output reg  [2:0]   ALUctrl
  );

   always @(ALUop or funct)
    case(ALUop)
    3'b010:   ALUctrl = 3'b010;
    3'b011:   ALUctrl = 3'b110;
    3'b000:   ALUctrl = 3'b000;
    3'b001:   ALUctrl = 3'b001;
    3'b100:   case(funct)
              6'b100000:       ALUctrl = 3'b010;
              6'b100010:       ALUctrl = 3'b110;
              6'b100100:       ALUctrl = 3'b000;
              6'b100101:       ALUctrl = 3'b001;
              6'b101010:       ALUctrl = 3'b111;
              endcase // case (funct)
     endcase // case (ALUop)
endmodule